<?php

namespace front\models;
use common\ActiveRecord;
use Yii;

/**
 * This is the model class for table "banner".
 *
 * @property string $id
 * @property string $name
 * @property string $uid
 * @property string $product_id
 * @property string $created_at
 * @property string $updated_at
 * @property string $pic_url
 * @property integer $status
 */
class BannerModel extends \common\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'banner';
    }

    /**
     * @return \yii\db\Connection the database connection used by this AR class.
     */
    public static function getDb()
    {
        return Yii::$app->get('db');
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['name', 'uid', 'product_id', 'created_at', 'pic_url'], 'required'],
            [['uid', 'product_id', 'created_at', 'updated_at', 'status'], 'integer'],
            [['name'], 'string', 'max' => 60],
            [['pic_url'], 'string', 'max' => 255]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'name' => 'Name',
            'uid' => 'Uid',
            'product_id' => 'Product ID',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
            'pic_url' => 'Pic Url',
            'status' => 'Status',
        ];
    }
}
